﻿using CommunityToolkit.Mvvm.ComponentModel;
using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeConfigure.ViewModels
{
    internal class ColumnBarViewModel : ObservableObject
    {
        public ColumnBarViewModel()
        {
            this.SeriesCollection = new SeriesCollection()
            {
                new ColumnSeries
                {
                    Title = "拖拉机",
                    Values = new ChartValues<double>{ 10, 30, 50, 20 }
                }
            };
            this.SeriesCollection.Add(new ColumnSeries
            {
                Title = "割草机",
                Values = new ChartValues<double>{ 20, 33, 33, 55 }
            });
            this.Labels = new List<string>
            {
                "好的",
                "故障的",
                "坏的",
                "报废的"
            };
        }
        #region Property
        private SeriesCollection _seriesCollection;
        public SeriesCollection SeriesCollection
        {
            get => _seriesCollection;
            set => SetProperty(ref _seriesCollection, value);
        }

        private List<string> _labels;
        public List<string> Labels
        {
            get => _labels;
            set => SetProperty(ref _labels, value);
        }
        #endregion
    }
}
